import pygame as p
import sys


def lineleft():
    road = [[0,0]]
    for x in range(0, 640):
        y = -5 * x + 1000
        road.append([x, y])
        p.draw.lines(screen, [0, 0, 0], False, road, 5)
    p.display.flip()
def lineright():
    road = [[200,0]]
    for x in range(0, 640):
        y = 5 * x - 2000
        road.append([x, y])
        p.draw.lines(screen, [0, 0, 0], False, road, 5)
    p.display.flip()

def linemiddle():
    road=[[300,0]]
    for y in range(0,480,20):
        road.append([300,y])
        if len(road)==2:
            p.draw.lines(screen, [0, 0, 0], False, road, 5)
            road=[[300,0]]
    p.display.flip()

p.init()
screen = p.display.set_caption('my car')
screen = p.display.set_mode([640, 480])
screen.fill([255, 255, 255])
lineleft()
lineright()
linemiddle()

while True:
    for event in p.event.get():
        if event.type == p.QUIT:
            sys.exit()
